package com.horizon.common.controller;

import com.horizon.common.exception.HorizonException;
import com.horizon.common.util.HorizonUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 地坪线系统基础controller.
 *
 * @author zhaoshb
 * @since 2022/11/29 00:54
 */
public class HorizonBaseController extends BladeController {

    @ExceptionHandler
    public R handleException(HorizonException e) {
        return R.fail(e.getResultCode().getCode(), HorizonUtil.getLocaleMessage(e.getResultCode()));
    }
}
